<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUserTeamsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('user_teams', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->string('name', 100)->nullable()->comment('等级名称');
			$table->integer('user_num')->nullable()->default(0)->comment('直推会员数量');
			$table->decimal('user_money', 10)->nullable()->default(0.00)->comment('用户金额 单位为分 防止浮点数错误');
			$table->integer('reward')->nullable()->default(0)->comment('设置团队分成比例');
			$table->integer('level')->nullable()->comment('会员等级 标记级别高低');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('user_teams');
	}

}
